package com.springboot.demo.core.exception;

import com.springboot.demo.core.constant.CodeMsg;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 自定义异常类
 *
 * @author Francis
 * @date 2019-07-05 16:30
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class CosyException extends RuntimeException {

    private int code;
    private String msg;

    public CosyException(CodeMsg codeMsg){
        this.msg = codeMsg.getMsg();
        this.code = codeMsg.getCode();
    }
}
